﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;
using System.IO;

namespace GameHighlights
{
    public partial class MyMessageBox : Form
    {
        public MyMessageBox()
        {
            InitializeComponent();
        }

        public MyMessageBox(string Message, string Caption, MyMessageBoxIcon Icon)
        {
            InitializeComponent();

            this.Text = Caption;
            lblMessage.Text = Message;
            

            switch (Icon)
            {
                case MyMessageBoxIcon.GreatGoingOne:
                    picbxImage.Image = GameHighlights.Properties.Resources._1;//"..//..//Image/1.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingTwo:
                    picbxImage.Image = GameHighlights.Properties.Resources._2;//"..//..//Image/2.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingThree:
                    picbxImage.Image = GameHighlights.Properties.Resources._3;//"..//..//Image/3.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingFour:
                    picbxImage.Image = GameHighlights.Properties.Resources._4;//"..//..//Image/4.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingFive:
                    picbxImage.Image = GameHighlights.Properties.Resources._5;//"..//..//Image/5.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingSix:
                    picbxImage.Image = GameHighlights.Properties.Resources._6;//"..//..//Image/6.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingSeven:
                    picbxImage.Image = GameHighlights.Properties.Resources._7;//"..//..//Image/7.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingEight:
                    picbxImage.Image = GameHighlights.Properties.Resources._8;//"..//..//Image/8.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingNine:
                    picbxImage.Image = GameHighlights.Properties.Resources._9;//"..//..//Image/9.gif";
                    break;
                case MyMessageBoxIcon.FailedAtLevelOne:
                case MyMessageBoxIcon.FailedAtLevelTwo:
                case MyMessageBoxIcon.FailedAtLevelThree:
                    picbxImage.Image = GameHighlights.Properties.Resources.emptyHead;//"..//..//Image/emptyHead.gif";
                    break;
                case MyMessageBoxIcon.FailedAtLevelFour:
                case MyMessageBoxIcon.FailedAtLevelFive:
                case MyMessageBoxIcon.FailedAtLevelSix:
                    picbxImage.Image = GameHighlights.Properties.Resources.clap;//"..//..//Image/clap.gif";
                    break;
                case MyMessageBoxIcon.FailedAtLevelSeven:
                case MyMessageBoxIcon.FailedAtLevelEight:
                case MyMessageBoxIcon.FailedAtLevelNine:
                case MyMessageBoxIcon.FailedAtLevelTen:
                    picbxImage.Image = GameHighlights.Properties.Resources.wellplayed;//"..//..//Image/wellplayed.gif";
                    break;
                case MyMessageBoxIcon.CrossedAllLevels:
                    picbxImage.Image = GameHighlights.Properties.Resources.winner;//"..//..//Image/winner.gif";
                    break;
                default:
                    break;
            }
            //if (File.Exists("..//..//Image/finished.wav"))
            //{
                SoundPlayer player = new SoundPlayer(GameHighlights.Properties.Resources.finished);
                player.Load();
                player.Play();
                player.Dispose();
            //}
            
        }

     

      
        private void MyMessageBox_Load(object sender, EventArgs e)
        {
            //picbxImage.ImageLocation =  "..//..//Image/donkey guitar.gif";
        }

        //Depreciated
        private string Show(string Message, string Caption, MyMessageBoxIcon Icon)
        {
            this.Text = Caption;
            lblMessage.Text = Message;

            switch (Icon)
            {
                case MyMessageBoxIcon.GreatGoingOne:
                    picbxImage.ImageLocation = "..//..//Image/1.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingTwo:
                    picbxImage.ImageLocation = "..//..//Image/2.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingThree:
                    picbxImage.ImageLocation = "..//..//Image/3.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingFour:
                    picbxImage.ImageLocation = "..//..//Image/4.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingFive:
                    picbxImage.ImageLocation = "..//..//Image/5.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingSix:
                    picbxImage.ImageLocation = "..//..//Image/6.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingSeven:
                    picbxImage.ImageLocation = "..//..//Image/7.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingEight:
                    picbxImage.ImageLocation = "..//..//Image/8.gif";
                    break;
                case MyMessageBoxIcon.GreatGoingNine:
                     picbxImage.ImageLocation = "..//..//Image/9.gif";
                    break;
               
                case MyMessageBoxIcon.FailedAtLevelOne:
                case MyMessageBoxIcon.FailedAtLevelTwo:
                case MyMessageBoxIcon.FailedAtLevelThree:
                    picbxImage.ImageLocation = "..//..//Image/emptyHead.gif";
                    break;
                case MyMessageBoxIcon.FailedAtLevelFour:
                case MyMessageBoxIcon.FailedAtLevelFive:
                case MyMessageBoxIcon.FailedAtLevelSix:
                    picbxImage.ImageLocation = "..//..//Image/clap.gif";
                    break;
                case MyMessageBoxIcon.FailedAtLevelSeven:
                case MyMessageBoxIcon.FailedAtLevelEight:
                case MyMessageBoxIcon.FailedAtLevelNine:
                case MyMessageBoxIcon.FailedAtLevelTen:
                    picbxImage.ImageLocation = "..//..//Image/wellplayed.gif";
                    break;
                case MyMessageBoxIcon.CrossedAllLevels:
                    picbxImage.ImageLocation = "..//..//Image/winner.gif";
                    break;
                default:
                    break;
            }
            return "OK";

        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }

    public enum MyMessageBoxIcon
    {
        None = 0,
        GreatGoingOne = 1,
        GreatGoingTwo = 2,
        GreatGoingThree = 3,
        GreatGoingFour = 4,
        GreatGoingFive = 5,
        GreatGoingSix = 6,
        GreatGoingSeven = 7,
        GreatGoingEight = 8,
        GreatGoingNine =9,
        GreatGoingTen = 10,
        FailedAtLevelOne = 11,
        FailedAtLevelTwo = 12,
        FailedAtLevelThree = 13,
        FailedAtLevelFour = 14,
        FailedAtLevelFive = 15,
        FailedAtLevelSix = 16,
        FailedAtLevelSeven = 17,
        FailedAtLevelEight = 18,
        FailedAtLevelNine = 19,
        FailedAtLevelTen = 20,
        CrossedAllLevels = 25
    }
}
